Given that the DB classes already check read-only mode and bad
transaction states are already handled by
3975e04cf4d, this
code was not useful.
Change-Id: I4b6e8909196448a12cf74598de0272fa43bdfc62
protected function handleWriteError( DBError $exception, IDatabase $db = null, $serverIndex ) {
if ( !$db ) {
$this->markServerDown( $exception, $serverIndex );
- } elseif ( $db->wasReadOnlyError() ) {
- if ( $db->trxLevel() && $this->usesMainDB() ) {
- // Errors like deadlocks and connection drops already cause rollback.
- // For consistency, we have no choice but to throw an error and trigger
- // complete rollback if the main DB is also being used as the cache DB.
- throw $exception;
- }
}
$this->logger->error( "DBError: {$exception->getMessage()}" );